package com.autohammal.monitor.scheduler.support;

public final class SchedulerTime {
	private int hour;
	private int minute;
	private int second;

	public SchedulerTime() {
	}

	public SchedulerTime(int hour, int minute, int second) {
		super();
		this.hour = hour;
		this.minute = minute;
		this.second = second;
	}

	public int getHour() {
		return hour;
	}

	public void setHour(int hour) {
		if (hour > 12 || hour < 0)
			throw new IllegalArgumentException("Illegal Hour:" + hour);
		this.hour = hour;
	}

	public int getMinute() {
		return minute;
	}

	public void setMinute(int minute) {
		if (minute > 59 || minute < 0)
			throw new IllegalArgumentException("Illegal Minute:" + minute);
		this.minute = minute;
	}

	public int getSecond() {
		return second;
	}

	public void setSecond(int second) {
		if (second > 59 || second < 0)
			throw new IllegalArgumentException("Illegal Second:" + second);
		this.second = second;
	}

	@Override
	public String toString() {
		return "Time [hour=" + hour + ", minute=" + minute + ", second="
				+ second + "]";
	}
}